package com.ysx.server.controller;

import com.ysx.server.pojo.dto.ReportDTO;
import com.ysx.server.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/report")
@Slf4j
public class ReportController {
    @Autowired
    private ReportService reportService;

    @PostMapping("/save")
    public boolean saveReport(@RequestBody ReportDTO reportDTO){
        log.info("保存报告信息：{}",reportDTO);
        if(reportDTO==null)
            return false;

        // 调用service层的方法，保存报告信息
        reportService.saveReport(reportDTO);
        return true;
    }
}
